package com.ai.controller.made;


import com.ai.annotation.EnterPathParamLog;
import com.ai.common.CommonResponse;
import com.ai.entity.cameraFunctions.CameraFlowCollectionPlatformPage;
import com.ai.entity.cameraFunctions.CameraFlowCollectionPlatformParam;
import com.ai.service.made.ICameraFlowCollectionPlatformService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jiaok
 * @since 2024-08-27
 */
@RestController
@RequestMapping("/camera-flow-collection-platform")
public class CameraFlowCollectionPlatformController {

    @Resource
    private ICameraFlowCollectionPlatformService iCameraFlowCollectionPlatformService;

    @ApiOperation("取流平台分页查询")
    @PostMapping("list")
    @EnterPathParamLog
    public CommonResponse list(@RequestBody CameraFlowCollectionPlatformPage platformPage) {

        return iCameraFlowCollectionPlatformService.pageList(platformPage);

    }



    @ApiOperation("添加取流平台")
    @PostMapping("addNewPlat")
    @EnterPathParamLog
    public CommonResponse addNewPlat(@RequestBody CameraFlowCollectionPlatformParam cameraFlowCollectionPlatformParam) {

        return iCameraFlowCollectionPlatformService.addNewPlat(cameraFlowCollectionPlatformParam);

    }

    @ApiOperation("获取指定平台信息")
    @PostMapping("getPlatInfo/{id}")
    @EnterPathParamLog
    public CommonResponse getPlatInfo(@PathVariable(name = "id") String id ) {

        return iCameraFlowCollectionPlatformService.getPlatInfo(id);

    }


    @ApiOperation("编辑取流平台信息")
    @PostMapping("editPlatInfo")
    @EnterPathParamLog
    public CommonResponse editPlatInfo( @RequestBody CameraFlowCollectionPlatformParam cameraFlowCollectionPlatformParam ) {

        return iCameraFlowCollectionPlatformService.editPlatInfo(cameraFlowCollectionPlatformParam);

    }


    @ApiOperation("删除取流平台信息")
    @PostMapping("delPlatInfo/{id}")
    @EnterPathParamLog
    public CommonResponse delPlatInfo( @PathVariable(name = "id") String id ) {

        return iCameraFlowCollectionPlatformService.delPlatInfo(id);

    }

    @ApiOperation("获取所有取流平台")
    @PostMapping("gePlatList")
    @EnterPathParamLog
    public CommonResponse gePlatList( ) {

        return iCameraFlowCollectionPlatformService.gePlatList();

    }

}
